# coding=utf-8

from PIL import Image
import glob, os

# 旋转图片
im = Image.open("./checkin.jpg")
im.rotate(45).show()

size = 128, 128

for infile in glob.glob('*.jpg'):
    print infile
    file, ext = os.path.splitext(infile)
    print file, ext
    im = Image.open(infile)
    im.thumbnail(size)
    im.save(file + "_thumbnail", "jpeg")
